package copy;

import com.whalin.MemCached.MemCachedClient;
import com.whalin.MemCached.SockIOPool;

public class test {
	private static MemCachedClient mcc;
	static {
		mcc = new MemCachedClient();
		SockIOPool pool = SockIOPool.getInstance();
		String[] servers = { "192.168.1.188:11211" };
		Integer[] weights = { 3 };
		pool.setServers(servers);
		pool.setWeights(weights);
		pool.setInitConn(5);
		pool.setMinConn(5);
		pool.setMaxConn(250);
		// ����ÿ������������ʱ��6��Сʱ
		pool.setMaxIdle(1000 * 60 * 60 * 6);
		pool.setMaintSleep(300);
		// set some TCP settings
		// disable nagle
		// set the read timeout to 3 secs
		// and don't set a connect timeout
		pool.setNagle(false);
		pool.setSocketTO(3000);
		pool.setSocketConnectTO(0);
		pool.initialize();
	}

	public static MemCachedClient getMemCachedClient() {
		return mcc;
	}
	public static void main(String[] args) {
		System.out.println(getMemCachedClient().set("userId", "1234"));
	}
}
